import json
from datetime import datetime


class Utils:
    def datetime_to_str(obj):
        if isinstance(obj, datetime):
            return obj.strftime('%Y-%m-%d %H:%M:%S')
        raise TypeError("Object of type %s is not JSON serializable" % type(obj))
